package top.toptimus.dto.order.orderSync.orderVersion;

import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.util.DateTimeUtil;

import java.util.Date;

/**
 * 订单版本控制
 */
@NoArgsConstructor
@Data
public class OrderVersionDTO {
    private String id;
    private String orderId;
    private int version;
    private Date versionDate;

    public OrderVersionDTO(
            String id,
            String orderId,
            int version,
            Date versionDate
    ) {
        this.id = id;
        this.orderId = orderId;
        this.version = version;
        this.versionDate = versionDate == null ? DateTimeUtil.getCurrentDate() : versionDate;
    }
}
